const App = getApp();
Page({
    data: {
        imgUrl:App.globalData.imgUrl,
        isLoading: true,
        reLoading: false,
        card_id: 0,
        detail: {},
    },
    onLoad: function (options) {
        let _this = this;
        _this.setData({
            card_id: options.card_id
        });
        _this.getDetail();
    },

    // 获取详情
    getDetail() {
        let _this = this;
        App._get('card/detail', {
            card_id: _this.data.card_id
        }, res => {
            _this.setData(res.data)
        }, false, () => {
            _this.setData({
                isLoading: false,
                reLoading: false,
            })
        });
    },

    // 复制文字成功
    copyText(e) {
        let _this = this;
        wx.setClipboardData({
            data: e.currentTarget.dataset.text,
            success: function (res) {
                wx.getClipboardData({
                    success: function (res) {
                        wx.showToast({
                            title: '复制成功'
                        })
                    }
                })
            }
        })
    },


});
